]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
authPrompt: Grab key focus when making entry sensitive
authorJonas Dreßler <verdre@v0yd.nl>
Wed, 22 Apr 2020 15:27:54 +0000 (17:27 +0200)
committerFlorian Müllner <florian.muellner@gmail.com>
Sat, 25 Apr 2020 14:54:07 +0000 (14:54 +0000)
We currently let the entry of the autoPrompt grab the key focus inside
setQuestion(), which is called from _onAskQuestion(), which is the
callback of the "ask-question" signal.

It seems that the "ask-question" signal isn't emitted again right after
the password-check failed, but a few seconds after that. Since we get
the "verification-failed" signal earlier than "ask-question" (right
after we know the check failed) and we also get a hint whether the entry
should be usable again with the canRetry argument, we can also grab key
focus to in the same step.

So do that by grabbing key focus when making the entry sensitive.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/2655

js/gdm/authPrompt.js

index c26b1bcad5cfef9b6a0f4cc0ab9d9ca1422bc446..29170c555a015bf0426b8e0f81412fb82fb066d2 100644 (file)
@@ -424,7 +424,13 @@ var AuthPrompt = GObject.registerClass({
     }
 
     updateSensitivity(sensitive) {
+        if (this._entry.reactive === sensitive)
+            return;
+
         this._entry.reactive = sensitive;
+
+        if (sensitive)
+            this._entry.grab_key_focus();
     }
 
     vfunc_hide() {